package sessionManager;


import java.util.Collection;
import java.util.List;

import user.UserIF;
import user.blog.BlogIF;
import user.blog.post.comments.Comment;
import user.blog.post.comments.ManageComments;

public interface SessionManagerIF {
	
public void loadData();
	
	/**
	 * Check if the login is registered in the database.
	 * @throws Exception 
	 */
	public boolean checkIfLoginExists(String login, String password) throws Exception ;
	/**
	 * Check if the user is logged in the system.
	 * @param login
	 * @return boolean
	 * @throws Exception 
	 */
	public boolean isUserLogged(String login) throws Exception;
	/**
	 * Get one user by his sessionID.
	 * @param sessionID
	 * @return Object User.
	 * @throws Exception if sessionID is incorrect. 
	 */
	public UserIF getUserBySessionID(String sessionID) throws Exception;
	/**
	 * Remove the user from database, has to be logged for that.
	 * @param sessionID
	 * @return boolean
	 * @throws Exception if sessionID is incorrect.
	 */
	public boolean removeUser(String sessionID) throws Exception;
	/**
	 * Logoff the user from the system.
	 * @param sessionID
	 * @return boolean
	 * @throws Exception if sessionID is incorrect.
	 */
	public boolean logoffUser(String sessionID) throws Exception;
	/**
	 * Log user in the system.
	 * @param login
	 * @param password
	 * @return the Session ID
	 * @throws Exception 
	 */
	public String loginUser(String login, String password) throws Exception;
	/**
	 * Get some information from user by his sessionID.
	 * @param sessionID
	 * @param flag(string that matches with the enum FLAGS)
	 * @return information in string
	 * @throws Exception if flag is incorrect.
	 */
	public String getProfileInformationBySessionId(String sessionID, String flag) throws Exception;
	/**
	 * 
	 * @param login
	 * @return Number of blogs.
	 * @throws Exception 
	 */
	public Integer getNumberOfBlogsByLogin(String login) throws Exception;
	/**
	 * 
	 * @param login
	 * @param index of blog
	 * @return blogID
	 * @throws Exception 
	 */
	public String getBlogByLogin(String login, Integer index) throws Exception;

	List<BlogIF> getAllBlogs();

	Collection<UserIF> getUsers();

	BlogIF getBlogByBID(String bid) throws Exception;

	List<ManageComments> getComments() throws Exception;

	void clear();
}
